import request from '@/utils/request'

// 查询APP交易记录列表
export function listPayRecord(query) {
  return request({
    url: '/app/payRecord/list',
    method: 'get',
    params: query
  })
}
// 查询APP油卡交易记录列表
export function listOilcardPayRecord(query) {
  return request({
    url: '/app/payRecord/oilcardList',
    method: 'get',
    params: query
  })
}

// 查询APP交易记录列表
export function listBalanceRecord(query) {
  return request({
    url: '/app/balanceRecord/list',
    method: 'get',
    params: query
  })
}


// 查询APP交易记录详细
export function getPayRecord(recordId) {
  return request({
    url: '/app/payRecord/' + recordId,
    method: 'get'
  })
}

// 新增APP交易记录
export function addPayRecord(data) {
  return request({
    url: '/app/payRecord',
    method: 'post',
    data: data
  })
}

// 修改APP交易记录
export function updatePayRecord(data) {
  return request({
    url: '/app/payRecord',
    method: 'put',
    data: data
  })
}

// 修改充值状态
export function updateRechargeState(recordId,rechargeState) {
  return request({
    url: '/app/payRecord/updateRechargeState',
    method: 'post',
    data: {
      recordId:recordId,
      rechargeState:rechargeState
    }
  })
}

// 退款
export function refund(recordId) {
  return request({
    url: '/app/payRecord/refund',
    method: 'post',
    data: {
      recordId:recordId
    }
  })
}

// 删除APP交易记录
export function delPayRecord(recordId) {
  return request({
    url: '/app/payRecord/' + recordId,
    method: 'delete'
  })
}

// 导出APP交易记录
export function exportPayRecord(query) {
  return request({
    url: '/app/payRecord/export',
    method: 'get',
    params: query
  })
}
